<?php defined('SMIT_PATH') or die('Access Denied');
/**
 *	devel/app.php - Testing Application
 *	This is Smit Matterhorn - Build 24109
 *	
 *
 * @author		The SmitBoard Team & Community
 * @license		GNU GPL v3
 * @link		http://smitboard.sf.net
 * @since		Matterhorn
 */
 
class Devel extends SmitApp
{
	function main()
	{
		//echo $this->base->output->createUrl(array('act' => 'forum', 'fid' => 4, 'mode' => 1, 'filter' => 'bypost'), 'jh', 1);
		//$this->base->output->setDir('smitpro');
		//$this->base->output->setTitle('Test Page');
		//$this->base->output->process('forum.test');
		//$this->base->output->flush();
		$this->base->load('authd');
		/*
		$this->base->output->buildNavigation(
			array('Index', array()),
			array('Support <b>ggg</b>', array('act' => 'forum', 'id' => 3)),
			array('Who Put & this?', array('act' => 'topic', 'id' => 54))
		);
		echo implode(' &rarr; ', $this->base->output->navigation);*/
		/*
		$this->base->loadHandler('forum');
		print $this->base->lib->bbcode_parse('[b]Test[/b]
		[i]test[/i] [[BBCode]]');*/
		/*mysql_select_db('ipb131');
		$this->base->output->sendContent('txt');
		$this->base->db->execute('SHOW TABLES');
		echo  
'--
-- --------------------------------------------
--  Smit Database Backup [Auto-Generated]
--  DATABASE: "'.$this->base->db->driver.'"
--  GENERATED ON: '.date('r').'
-- --------------------------------------------
--
';
		foreach($this->base->db->result() as $table)
		{
			$this->base->db->execute('SHOW CREATE TABLE `' . $table[0] . '`');
			$str = '';
			$str .= '

--
-- --------------------------------------------
--  TABLE: "'.$table[0].'" STRUCTURE
-- --------------------------------------------
--
';
			$str .= $this->base->db->row(1) . ';' . chr(10) . chr(10);
			echo $str;
			$this->base->db->execute('SELECT * FROM `' . $table[0] . '`');
			if($this->base->db->num_rows() > 0)
			{
				$data = $this->base->db->result(NULL, 2);
				$query = 'INSERT INTO `' . $table[0] . '` VALUES ' . chr(10);
				foreach($data as $ins)
				{
					$query .= '(';
					foreach($ins as $in)
					{
						$query .= '\'' . $this->base->db->escape($in) . '\',';
					}
					$query = substr($query, 0, strlen($query) - 1);
					$query .= '),' . chr(10);
				}
				$query = substr($query, 0, strlen($query) - 2) . ';';
				print $query;
			}
		}*/
	}
}

?>